home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Essentials / MacApp Documentation / MacApp AppleLink Messages / MacApp.Tech$ 6⁄15⁄90 / 1422-Re Cmd not disabled -Jun90 < prev    next >
Encoding:
Text File  |  1990-06-15  |  2.1 KB  |  48 lines  |  [TEXT/GEOL]

  1. Item    7612379                         9-June-90        21:33PDT
  2.  
  3. From:   D0416                           Futuresoft System Design,PRT
  4.  
  5. To:     A.XSE010                        Austria - SLT Labinstruments,IDV
  6.  
  7. cc:     MACAPP.TECH$                    MacApp Technical
  8.  
  9. Sub:    RE-Cmd not disabled on close
  10.  
  11. Alex,
  12.  
  13. It seems no one yet has responded to your message about view-specific menu
  14. items not disabled when all views are closed in your application. Here’s a shot
  15. as to what I think may be wrong. Keep in mind that the first thing MacApp does
  16. before calling DoSetupMenus is to disable all menu items (commands) not under
  17. the Apple menu.
  18.  
  19. First idea:
  20. Some TEventHandler (in the target chain) higher up than the views that are
  21. closed must be enabling the menu item (command). Normally, the only
  22. TEventHandler objects higher up the chain would be either a TDocument object or
  23. a TApplication object. Check and see if you are calling Enable(aViewCommand,
  24. TRUE) in TYourApp.DoSetupMenus and TYourDoc.DoSetupMenus methods. Usually, a
  25. TYourView specific command should ONLY be enabled/disabled in
  26. TYourView.DoSetupMenus.
  27.  
  28. Second idea:
  29. Check in your TYourApp.DoSetupMenus and TYourDoc.DoSetupMenus to see if you are
  30. calling INHERITED DoSetupMenus. This is very important because this enables the
  31. mechanism that allows MacApp to traverse the target chain and call DoSetupMenus
  32. for each object in the chain. While your at it, you might also want to check
  33. for this in TYourView, if you are OVERRIDEing TView.DoSetupMenus.
  34.  
  35. Hope that helps without adding more confusion,
  36. -Ken Addison
  37.  FutureSoft System Designs, Inc.
  38.  
  39. PS: You should call INHERITED DoSetupMenus _before_ you do your Enable's in
  40. order to give objects “higher” in the target chain the a chance to Enable
  41. commands _before_ the “lower” objects. This allows the lower objects to sort of
  42. override enabling a command MacApp may have enabled or disabled.
  43.  
  44. But, for DoMouseCommand and DoKeyCommand you call INHERITED DoMouseCommand or
  45. DoKeyCommand _after_ you process the command and then only if the “current”
  46. object can’t handle the command.
  47.  
  48.